package leetcode;
import java.util.List;
import java.util.ArrayList;
public class Noname {
	public static void main(String []args) {
//		List<String> ans =new ArrayList<>();
//		func(0,"25525511135",ans,"",0);
		System.out.println();
		test(0,"");
	}
	public static void func(int index,String s,List<String> ans,String path,int count) {
		if(count==3) {
			if(index == s.length()) {
				ans.add(new String(path));
			}
			return ;	
		}
		if(s.charAt(index) == '0') {
			return ;
		}
		String str="";
		for(int i= index; i <=index+3 ;i++) {
			str+=s.charAt(i);
			if(Integer.parseInt(str)>255) {
				return ;
			}
			func(i+1,s,ans,path+str+'.',count+1);
		}
	}
	public static void test(int count,String s) {
		if(count==3) {
			System.out.println(s);
			return ;
		}
		String str="*";
		test(count+1,s+'@');
	}
}
